module.exports = () => {
    return async (ctx, next) => {
        try {
            await next()
        } catch (err) {
            ctx.body = {
                code: -2,
                err,
            }
            ctx.status = 500
        }
    }
}